package com.github.thinwonton.cas.showcase.webapp.servlet;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 团购模块
 */
public class GrouponServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String pathInfo = request.getPathInfo();
        if (pathInfo == null || "".equals(pathInfo) || "/".equals(pathInfo)) {
            //返回用户首页
            RequestDispatcher dispatcher = request.getRequestDispatcher("WEB-INF/views/groupon/index.jsp");
            dispatcher.forward(request, response);
        } else {
            //TODO
        }
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }
}
